<html>
    <head>
        <title>Test</title>
        <style>

body {
  flow:horizontal-wrap;
  size:*;
}

body > div {
  size:*;
  border:1px solid;
  transition: size linear 200ms;
}

body > div:hover {
  size:2*;
}

body > div:nth-child(5n) { clear:after; }

        </style>

    </head>
    <body>

      <div>0</div>
      <div>1</div>
      <div>2</div>
      <div>3</div>
      <div>4</div>

      <div>5</div>
      <div>6</div>
      <div>7</div>
      <div>8</div>
      <div>9</div>

      <div>10</div>
      <div>11</div>
      <div>12</div>
      <div>13</div>
      <div>14</div>

      <div>15</div>
      <div>16</div>
      <div>17</div>
      <div>18</div>
      <div>19</div>

      <div>20</div>
      <div>21</div>
      <div>22</div>
      <div>23</div>
      <div>24</div>

    </body>
</html>